package com.ruoyi.common.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName BsJingquTypeEnum
 * @Description 描述
 * @Author HanWL
 * @Date 2024/5/27 22:05
 * @Version 1.0
 **/
public enum BsJingquTypeEnum {

    CENTER(4,"游客集散中心"),
    A5(1,"舒城县5A景区"),

    A4(2,"舒城县4A景区"),

    A3(3,"舒城县3A景区")


    ;


    private Integer type;

    private String name;

    BsJingquTypeEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public static String getName(Integer type) {
        for (BsJingquTypeEnum value : BsJingquTypeEnum.values()) {
            if (value.getType().equals(type)) {
                return value.getName();
            }
        }
        return null;
    }

    /**
     * 获取type和name的Map对象集合
     * @return
     */
    public static List<Map<String, Object>> getTypeAndNameMap() {
        List<Map<String, Object>> resultList = new ArrayList<>();
        for (BsJingquTypeEnum value : BsJingquTypeEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("name", value.getName());
            map.put("value", value.getType());
            resultList.add(map);
        }
        return resultList;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
